<template>
	<view style="min-height: 100vh;background-color: #ededed;">
		<view style="height: 30upx;"></view>
		<u-cell-group>
			<u-cell-item icon="pushpin" title="版本号" value="0.0.1" :arrow="false"></u-cell-item>
		</u-cell-group>
		
		<view v-if="userInfo.Account" style="height: 200upx;display: flex;align-items: center;justify-content: center;">
			<u-button @click="unBind" :ripple="true" size="medium" type="warning">解除绑定</u-button>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex"
	export default {
		computed:{
			...mapState("account",['token','userInfo'])
		},
		data() {
			return {
				
			};
		},
		methods:{
			// 解绑
			unBind(){
				uni.showModal({
					title:"提示",
					content:"确定解绑当前账号吗",
					confirmText:"解绑",
					cancelText:"再想想",
					success: (modalRes) => {
						if(modalRes.confirm){
							this.$store.dispatch("account/unBind").then(res=>{
								uni.showModal({
									title:"提示",
									content:"解绑成功",
									confirmText:"返回首页",
									showCancel:false,
									success: () => {
										uni.reLaunch({
											url:"/pages/oa/person/person"
										})
									}
								})
							})
						}
						
					}
				})
				
			}
		}
		
	 
	}
</script>

<style lang="scss">
 
</style>
